package com.repair.miniApp.service.impl;

import com.repair.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.repair.miniApp.mapper.RepairOrderMapper;
import com.repair.miniApp.domain.RepairOrder;
import com.repair.miniApp.service.RepairOrderService;

import java.util.List;


/**
 * 维修订单Service业务层处理
 *
 * @author repair
 * @date 2024-12-10
 */
@Service
public class RepairOrderServiceImpl implements RepairOrderService
{
    @Autowired
    private RepairOrderMapper repairOrderMapper;

    /**
     * 新增维修订单
     *
     * @param repairOrder 维修订单
     * @return 结果
     */
    @Override
    public int insertRepairOrder(RepairOrder repairOrder)
    {
        repairOrder.setCreateTime(DateUtils.getNowDate());
        return repairOrderMapper.insertRepairOrder(repairOrder);
    }

    @Override
    public List<RepairOrder> selectRepairOrderList() {
        return repairOrderMapper.selectRepairOrderList();
    }

    @Override
    public int updateStartInfo(RepairOrder repairOrder) {
        return repairOrderMapper.updateStartInfo(repairOrder);
    }

    @Override
    public int updateFinishInfo(RepairOrder repairOrder) {
        return repairOrderMapper.updateFinishInfo(repairOrder);
    }

}
